//遍历A的原型链，如果找到B.prototype，返回true，否则返回false

const _instanceof = (A, B) => {
  let p = A
  while(p) {
    if(p === B.prototype) {
      return true
    }
    p = p.__proto__
  }
  return false
}
